package com.menhai.personmanagement.controller;

import com.menhai.personmanagement.entity.EducationLog;
import com.menhai.personmanagement.plus.OperLog;
import lombok.extern.slf4j.Slf4j;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.menhai.personmanagement.services.IEducationBookService;
import com.menhai.personmanagement.entity.EducationBook;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 * 证书信息 前端控制器
 * </p>
 *
 * @author shikun
 * @since 2021-12-02
 */

@Slf4j
@RestController
@RequestMapping("/educationbook")
public class EducationBookController {

     @Autowired
     private IEducationBookService educationBookService;


     /**
      * @describe 删除医生证书
      * @param educationBook
      * @Return int
      * @Date 2021/12/6 10:02
      * @author shikun
      */
     @OperLog(operDesc = "删除医生证书",operType = "删除")
     @RequestMapping("/saveDeleteEducationBook")
     public int deleteById(EducationBook educationBook){
          return educationBookService.deleteById(educationBook);
     }



     /**
      * @describe 根据医生id 查询医生证书
      * @param educationBook
      * @Return java.util.List<com.menhai.personmanagement.entity.EducationBook>
      * @Date 2021/12/6 10:13
      * @author shikun
      */
     @RequestMapping("/EducationLogByUserIdList")
     public List<EducationBook> EducationLogByUserIdList (EducationBook educationBook){
          return educationBookService.EducationBookByUserIdList(educationBook);
     }

     /**
      * @describe 根据 证书id查询 证书实体
      * @param educationBook
      * @Return java.util.List<com.menhai.personmanagement.entity.EducationLog>
      * @Date 2021/12/6 15:25
      * @author shikun
      */
     @RequestMapping("/selectByprovebookid")
     public List<EducationBook> selectByprovebookid (EducationBook educationBook){
          return educationBookService.selectByprovebookid(educationBook);
     }



     /**
      * @describe 修改证书实体
      * @param educationBook
      * @Return int
      * @Date 2021/12/6 15:50
      * @author shikun
      */
     @OperLog(operDesc = "修改医生证书",operType = "插入")
     @RequestMapping("/updateByIdprovebook")
     public int updateByIdeducationLog(@RequestBody EducationBook educationBook){
          return educationBookService.updateByIdprovebook(educationBook);
     };


     /**
      * @describe 新增医生证书
      * @param educationBook
      * @Return int
      * @Date 2021/12/6 16:07
      * @author shikun
      */
     @OperLog(operDesc = "新增医生证书",operType = "插入")
     @RequestMapping("/educationBookinsert")
     public int educationBookinsert(@RequestBody EducationBook educationBook){
          return educationBookService.educationBookinsert(educationBook);
     }


}
